/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2017-7-24
*
\*********************************************************************/
#ifndef GPIO_MANAGE_H
#define GPIO_MANAGE_H

#include "Gpio.h"

#include <memory>
#include <map>

enum class GpioPinNum
{
    AD5693_GAIN_RESET = 110,//硬件复位引脚。IO输出高电平时，将RESET引脚拉低,RESET必须保持75ns的低电平才能完成该复位
    AD5693_ADDR_PROG = 3,//用于多个封装解码的可编程地址。地址引脚可即时更新
    MOTO_POWER_IO = 21,//高电平有效
    DISPLAY_EN_IO = 29,//高电平有效
    CCD_POWER_IO = 104,//高电平有效
    ADV7180_PAL_RESET = 7,//System Reset Input. Active low. A minimum low reset pulse width of 5 ms is required to reset the ADV7180 circuitry.
};

class GpioManage
{
public:
    static GpioManage& GetInstance();//获取GpioManage的实例
    GpioManage& operator = (const GpioManage&) = delete;
    GpioManage(const GpioManage&) = delete;
//    ~GpioManage();
private:
    static GpioManage m_Instance;    
    GpioManage();

private:
//    std::map<GpioPinNum, std::shared_ptr<Gpio>> m_gpios;
    std::map<GpioPinNum, std::unique_ptr<Gpio>> m_gpios;
public:
    void IoWrite(const GpioPinNum pinNum,const IoValue value);

};

#endif // GPIO_MANAGE_H
/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/

